<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录页面</title>
    <script src="./iconfont.js"></script>
    <style>
        *{
            margin: 0;
            padding: 0;
            font-family: sans-serif;
            box-sizing: border-box;
        }
        body{
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 100vh;
            background-color: rgb(194,184,184);
            background-image: url(https://p.qpic.cn/dnfbbspic/0/dnfbbs_dnfbbs_dnf_gamebbs_qq_com_forum_201911_22_083611h3sdmx38ezlxlw5e.jpg/0);
            background-size: cover;
        }
        .icon {
            width: 1.2em;
            height: 1.2em;
            vertical-align: -0.15em;
            fill: currentColor;
            overflow: hidden;
            position: absolute;
            right: 10px;
            top: 0;
            bottom: 0;
            margin: auto;
        }
        .wrapper{
            margin-left: 40%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            position: relative;
            width: 400px;
            height: 450px;
            background-color: rgba(50,50,50,.2);
            border: 1px solid rgba(255,255,255,.9);
            border-right: 1px solid rgba(255,255,255,.5);
            border-bottom: 0;
            border-radius: 20px;
            backdrop-filter: blur(10px);
        }
        .wrapper h2{
            font-size: 2em;
            color: #fff;
        }
        .wrapper .input-box{
            position: relative;
            width: 320px;
            margin: 30px 0;
            border-bottom: 2px solid #fff;
        }
        .input-box label{
            position: absolute;
            top: 50%;
            left: 5px;
            transform: translateY(-50%);
            /* 点击无效 */
            pointer-events: none;
            color: #fff;
            transition: .5s;
        }
        .input-box input:hover ~ label{
            top: 5px;
            font-size: 1.1em;
            color: rgba(255,255,255,.5);
        }
        .input-box input{
            width: 100%;
            height: 50px;
            background-color: transparent;
            border: none;
            outline: none;
            font-size: 1em;
            padding: 0 40px 0 50px;
            color: #fff;
        }
        .input-box i{
            position: absolute;
            right: 8px;
            line-height: 60px;
            transition: .5s;
        }
        .input-box span i:nth-child(2){
            opacity: 0;
        }

        .input-box input:hover ~ span i:nth-child(1){
            opacity: 0;
        }
        .input-box input:hover ~ span i:nth-child(2){
            opacity: 1;
            font-size: 1.1em;
        }
        .remember-forgot{
            width: 320px;
            display: flex;
            /* justify-content: space-around; */
            justify-content: space-between;
            margin: -15px 0 15px;
            font-size: 1.1em;
            color: #fff;
            transform: .5s;
        }
        .remember-forgot a{
            text-decoration: none;
            display: inline-block;
            height: 25px;
            color: #fff;
            transition: .5s;
        }
        .remember-forgot a:hover{
            color: rgba(255,255,255,.5);
            border-bottom: 1px solid #fff;
        }
        .remember-forgot label input{
            /* 为某些元素生成的用户界面控件设置主题色 */
            accent-color: rgba(93,86,143,.8);
            margin-right: 3px;
        }
        .wrapper button{
            width: 320px;
            height: 45px;
            border: none;
            background-color: rgba(93,86,143,.8);
            border-radius: 40px;
            cursor: pointer;
            font-size: 1em;
            font-weight: 500;
            color: #fff;
            transition: .5s;
        }
        .wrapper button:hover{
            box-shadow: 0 0 15px #555;
        }
        .register-link{
            font-size: 0.9em;
            margin: 25px 0 10px;
        }
        .register-link a{
            display: inline-block;
            text-decoration: none;
            color: #fff;
            font-weight: 600;
            height: 25px;
            transition: .5s;
        }
        .register-link a:hover{
            border-bottom: 1px solid rgba(255,255,255,.5);
            font-size: 1.1em;
        }
        /*取消微软浏览器的密码小眼睛样式*/
        input[type="password"]::-ms-reveal {
            display: none;
        }
    </style>
</head>
<body>
    <div class="wrapper">
        <h2>Login</h2>
        <div class="input-box">
            <input type="text">
            <label for="">账号：</label>
            <svg class="icon" aria-hidden="true">
                <use xlink:href="#icon-user"></use>
            </svg>
        </div>
        <div class="input-box">
            <input type="password" id="pwd-input">
            <label for="">密码：</label>
            <svg class="icon" aria-hidden="true" id="pwd-hid" onclick="HandlePwd()">
                <use xlink:href="#icon-hide"></use>
            </svg>
            <svg class="icon" style="display: none;" id="pwd-show" onclick="HandlePwd()" aria-hidden="true">
                <use xlink:href="#icon-browse"></use>
            </svg>
        </div>
        <div class="remember-forgot">
            <label for="">
                <input type="checkbox">
                记住密码
            </label>
            <a href="#">忘记密码</a>
        </div>
        <button type="submit">登 录</button>
        <div class="register-link">
            <p>
                还没账号？
                <a href="#">即刻注册</a>
            </p>
        </div>
    </div>
    <script>
        let pwdShow = false;
        function HandlePwd(){
            pwdShow = !pwdShow;
            if(pwdShow){
                document.querySelector("#pwd-show").style.display = "";
                document.querySelector("#pwd-hid").style.display = "none";
                document.querySelector("#pwd-input").type = "text";
            }else{
                document.querySelector("#pwd-show").style.display = "none";
                document.querySelector("#pwd-hid").style.display = "";
                document.querySelector("#pwd-input").type = "password";
            }
        }
    </script>
</body>
</html>